package com.creative.accountsdk.net;

import com.loopj.android.http.RequestParams;

import org.json.JSONObject;

/**
 * Created by yinjialiang on 15-7-22.
 * 通过IP查询国家代码
 */
public class LocaleProtocol extends Protocol{
    /**中国返回“CN”，找不到的国家代码也返回CN*/
    public String country;

    @Override
    public RequestParams getParams() {
        return new XParams().getParams();
    }

    @Override
    public String getUrl() {
        return getUrlPrefix() + "ipcn";
    }

    @Override
    protected void parseReturnMap(JSONObject returnMap) {
        country = returnMap.optString("country");
    }
}
